﻿using AutoMapper;
using TaskManager.Domain.BusinessObjects;
using TaskManager.Web.ViewModels;
using TaskManager.Web.ViewModels.Task;

namespace TaskManager.Web.Mappers
{
    /// <summary>
    /// Provides mapping from <see cref="Task"/> to <see cref="TaskEditModel"/>
    /// </summary>
    internal static class TaskMapper
    {
        /// <summary>
        /// Static constructor that registers mapping
        /// </summary>
        static TaskMapper()
        {
            Mapper.CreateMap<Task, TaskEditModel>();
        }

        /// <summary>
        /// Maps <see cref="Task"/> to <see cref="TaskEditModel"/>
        /// </summary>
        /// <param name="task">Task</param>
        /// <param name="editModel">View model</param>
        public static void Map(Task task, TaskEditModel editModel)
        {
            Mapper.Map(task, editModel);
        }
    }
}